package com.myjavalab.sort;

import com.myjavalab.util.DataUtil;
import com.myjavalab.util.PrintUtil;

public class BubbleSort {
	
	public static void sort(int[] ary, int start, int end) {
		PrintUtil.prt(ary);
		for(int i = end; start < i; i--) {
			for(int j = start; j < i; j++) {
				if(ary[j] > ary[j+1]) {
					DataUtil.swap(ary, j, j+1);
				}
			}
			PrintUtil.prt(ary);	
		}
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int[] arr = DataUtil.getNumber(100, 10);
		sort(arr,0,arr.length-1);
	}

}
